# Docker 镜像构建
# 基础镜像
# FROM openjdk:17
# 复制主机jar包至镜像内，复制的目录需放置在 Dockerfile 文件同级目录下
# ADD target/Star-0.0.1-SNAPSHOT.jar app.jar
# 容器启动执行命令
# ENTRYPOINT ["java","-jar", "/app.jar" , "--spring.profiles.active=prod"]
# 对外暴露的端口号
# EXPOSE  8080
FROM maven:3.5-jdk-8-alpine as builder

# Copy local code to the container image.
WORKDIR /app
COPY pom.xml .
COPY src ./src

# Build a release artifact.
RUN mvn package -DskipTests

# Run the web service on container startup.
CMD ["java","-jar","/app/target/Star-0.0.1-SNAPSHOT.jar","--spring.profiles.active=prod"]
EXPOSE  8080
